library _;

import 'package:flutter/material.dart';
import 'package:flutter_app/Const/IFinal.dart';
import 'package:flutter_app/Model/CartModel.dart';
import 'package:flutter_app/Model/OrderConfirmModel.dart';
import 'package:flutter_app/View/MyLoader.dart';
import 'package:flutter_yfree/YFree.dart';

part 'controller.dart';

class OrderConfirmPage extends YPage {
  OrderConfirmPage(this.cartMainModels);

  List<CartMainModel> cartMainModels;
  OrderConfirmModel? model;

  @override
  void yOnCreate() {
    controller_initData();
  }

  @override
  Widget yBuild(BuildContext context) {
    return Container(
      color: IFinal.Colors.pageBG,
      child: Column(
        children: [
          YAppBar(title: "确认订单"),
          Expanded(
            child: model == null
                ? MyLoader()
                : Column(
                    children: [
                      Card(
                        color: Colors.white,
                        margin: EdgeInsets.fromLTRB(10, 10, 10, 0),
                        child: YButton(
                          padding: EdgeInsets.only(top: 15, bottom: 15),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.center,
                            children: [
                              Icon(Icons.add, color: YConfig.themeColor),
                              YSpacer(width: 5),
                              Text("添加收货地址", style: TextStyle(color: YConfig.themeColor, fontWeight: FontWeight.bold, fontSize: 16)),
                            ],
                          ),
                          onTap: () {
                            yToast("message");
                          },
                        ),
                      ),
                    ],
                  ),
          ),
        ],
      ),
    );
  }
}
